package mdt.ext;

import org.tigris.gef.presentation.FigLine;
import mdt.action.SetFigShapeAttrAction;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.util.Vector;

/**
 * Created by xiaobyu on 7/19/2016.
 */
public class FigLineExt extends FigLine{
    public FigLineExt(int x1, int y1, int x2, int y2, Color lineColor) {
        super(x1, y1, x2, y2, lineColor);
    }

    /** Construct a new FigLine with the given coordinates and attributes. */
    public FigLineExt(int x1, int y1, int x2, int y2) {
        super(x1, y1, x2, y2);
    }

    /**
     * A convenient constructor for PGMLStackParser to create FigLines by
     * reflection. Do not consider this part of the normal API.
     */
    public FigLineExt() {
    }

    /** Construct a new FigLine with the given points. */
    public FigLineExt(Point p1, Point p2) {
        super(p1, p2);
    }

    public Vector getPopUpActions(MouseEvent me) {
        Vector popUpActions = super.getPopUpActions(me);
        popUpActions.add(new JSeparator());
        popUpActions.add(new JMenuItem(new SetFigShapeAttrAction()));
        return popUpActions;
    }
}
